<template>
  <div class="goodsdesc-container">
    <h3>{{ info.title }}</h3>
    <hr>
    <div class="content" v-html="info.content"></div>
  </div>
</template>

<script>
  export default {
    data(){
      return {
        info: {}
      }
    },
    created(){
      this.getGoodsDesc()
    },
    methods:{
      getGoodsDesc(){
        //获取图文描述
        /* this.$http.get("api/goods/getdesc" + this.$route.params.id).then(result=>{
          if(result.body.status===0){
            this.info = result.body.message[0]
          }
        }) */
        // 模拟数据
        this.info = {
          title:"Apple iPhone 8 64GB 红色特别版 移动联通电信4G手机",
          content:"Apple iPhone 8 64GB 红色特别版 移动联通电信4G手机<br><img src='http://m.360buyimg.com/babel/jfs/t8284/363/1326459580/71585/6d3e8013/59b857f2N6ca75622.jpg'><br>审美电脑欧冠偶尔，审美电脑欧冠偶尔，审美电脑欧冠偶尔，审美电脑欧冠偶尔审美电脑欧冠偶尔审美电脑欧冠偶尔审美电脑欧冠偶尔"
        }

      }
    }
  }
</script>

/* 文字中包含大的图片，去掉scoped并设定img的width 100%  */
<style lang="scss" >
.goodsdesc-container{
  padding: 4px;
  h3{
    font-size: 16px;
    color:#226aff;
    text-align: center;
    margin: 15px 0;
  }
  .content {
    img{
      width:100%;
    }
  }
}
</style>
